﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml.XPath;

namespace SCS.Web.UI.WebControls.Test
{
    public partial class ViewStateBypassTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                XPathDocument doc = new XPathDocument(Server.MapPath("~/resources/media.xml"));
                MediaOutline.DataSource = doc;
            }
        }

        protected void MediaOutline_ItemClicked(object sender, HierItemEventArgs e)
        {
            valueTextLabel.Text = MediaOutline.SelectedValue;
        }

        protected void MediaOutline_ViewStateSaving(object sender, ViewStateEventArgs e)
        {
            Cache["Ult1"] = e.StateInfo;
        }

        protected void MediaOutline_ViewStateLoading(object sender, ViewStateEventArgs e)
        {
            e.StateInfo = Cache["Ult1"];
        }

    }
}